import Mutils from '@/utils/index.jsx'
const _mm = new Mutils()

class User {
   login(loginInfo){
		return _mm.request({
			type:'post',
			url:'/manage/user/login.do',
			data:loginInfo
		})
	}
	checkLoginInfo( username , password ) {
		if(username.trim().length === 0){
			return {
				status:false,
				msg:'用户名不能为空'
			}
		}
		if(password.trim().length === 0){
			return {
				status:false,
				msg:'密码不能为空'
			}
		}
		return {
			status:true,
			msg:'验证通过'
		}
	}
	logout(){
		return _mm.request({
			type:'post',
			url:'/user/logout.do'
		})
	}
	getUserList({ pageNum }){
		return _mm.request({
			type:'post',
			url:'/manage/user/list.do',
			data:{
				pageNum
			}
		})
	}
}

export default User